# coding=utf-8

import msvcrt

def passwd():
    chars = []
    sys.stdout.write('请输入密码: ')
    while True:       
        newChar = msvcrt.getch()
        if newChar in '\r\n': # 如果是换行，则输入结束
            print ''
            break
        else:
            chars.append(newChar)
            sys.stdout.write('*') # 显示为星号
    global mima
    mima = ''.join(chars)
